package com.sx.entity.basic;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sx.basic.BasicEntity;
import com.sx.basic.serializer.LongToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author AdinZ
 * @date 2020/11/16 11:32
 */
@Data
@NoArgsConstructor
@TableName(value = "sx_upload_file")
@Entity
@Table(name = "sx_upload_file")
@ApiModel(description = "上传的文件")
public class FileEntity extends BasicEntity {
    @Id
    @GeneratedValue
    @TableId(type = IdType.ASSIGN_ID)
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;
    @ApiModelProperty("格式")
    private String format;
    @ApiModelProperty("路径")
    private String path;
    @ApiModelProperty("大小")
    private long size;
    @ApiModelProperty("创建时间")
    private long created=System.currentTimeMillis();

}
